package me.boot.sys.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import me.boot.common.data.model.Address;
import me.boot.db.mybatis.interceptor.foreign.ForeignKey;
import me.boot.gen.table.annotation.ColumnComment;

import java.time.LocalDateTime;

/**
 * <p>
 * </p>
 */
@Getter
@Setter
@ApiModel("公司表")
@TableName(autoResultMap = true)
public class SysCompany extends BaseOrgNode<SysCompany> {

    @ForeignKey(SysCompany.class)
    @ColumnComment("父级id")
    @ApiModelProperty(value = "父级id")
    @TableField
    private Long parentId;

    @ColumnComment("法人和其他组织统一社会信用代码")
    @ApiModelProperty(value = "法人和其他组织统一社会信用代码", notes = "共18位")
    @TableField
    private String creditCode;

    @ColumnComment("组织机构代码")
    @ApiModelProperty(value = "组织机构代码", notes = "由八位数字（或大写拉丁字母）本体代码和一位数字（或大写拉丁字母）校验码组成")
    @TableField
    private String orgCode;

    @ColumnComment("注册资本")
    @ApiModelProperty(value = "注册资本", notes = "万元")
    @TableField
    private Double registeredCapital;

    @ColumnComment("成立日期")
    @ApiModelProperty(value = "成立日期")
    @TableField
    private LocalDateTime setupDate;

    @ColumnComment("官网")
    @ApiModelProperty(value = "官网")
    @TableField
    private String website;

    @ColumnComment("公司地址")
    @ApiModelProperty(value = "公司地址")
    @TableField(typeHandler = JacksonTypeHandler.class)
    private Address address;

}
